<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="/WEB-INF/taglib/jstl.jsp" %>

<c:set var="isRevise" value="${false}"/>
<c:set var="styleRevise" value="" />
<c:if test="${not empty roleInfo}">
	<c:set var="isRevise" value="${true}"/>
	<c:set var="styleRevise" value="style='background-color:#E3E3E3;' readonly='readonly'" />
</c:if>
<div style="margin:2px 2px 2px 2px;">
	<form id="frmRoleReg">
		<table class="left-table">
		<tr>
			<td class="roleTitleTd">아이디</td>
			<td class="roleContsTd"><input type="text" id="roleId" name="roleId" value="${roleInfo.roleId}" ${styleRevise} /></td>
		</tr>
		<tr>
			<td class="roleTitleTd">역할 이름</td>
			<td class="roleContsTd"><input type="text" id="roleAlias" name="roleAlias" value="${roleInfo.roleAlias}" /></td>
		</tr>
		<tr>
			<td class="roleTitleTd">사용 여부</td>
			<td class="roleContsTd">
				<c:set var="roleUseY" value="checked='checked'" />
				<c:set var="roleUseN" value="" />
				<c:if test="${isRevise && roleInfo.roleUseYN == 'N'}">
					<c:set var="roleUseY" value="" />
					<c:set var="roleUseN" value="checked='checked'" />
				</c:if>

				<input type="radio" name="roleUseYN" value="Y" ${roleUseY} />Y
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="radio" name="roleUseYN" value="N" ${roleUseN} />N
			</td>
		</tr>
		<tr>
			<td class="roleTitleTd" style="height:86px;">설명</td>
			<td class="roleContsTd">
				<textarea id="roleDesc" name="roleDesc" style="width:95%; height:80px; resize:none;">${roleInfo.roleDesc}</textarea>
			</td>
		</tr>
		</table>
	</form>
</div>
<div class="roleBtnsDiv">
	<c:choose>
	<c:when test="${isRevise}"><input type="button" id="jqwFormReviseSaveBtn" value="수정" /></c:when>
	<c:otherwise><input type="button" id="jqwFormSaveBtn" value="저장" /></c:otherwise>
	</c:choose>

	<input type="button" id="jqwCloseBtn" value="닫기" />
</div>

<script type="text/javascript" src="/resources/js/views/template/system/role/_regForm.js"></script>
<script type="text/javascript" src="/resources/js/views/template/system/role/_regFormValid.js"></script>